/*******************************************************************************
 * 版权：北京润尼尔网络科技有限公司，保留所有版权<br>
 * 版本：v1.0.0<br>
 * 文件：DeviceModel.js<br>
 * 日期：2016年9月19日<br>
 * 作者: 王志远<br>
 * 功能：通用器件模型<br>
 * 
 * 修改记录：<br>
 * 日期 描述 更新功能<br>
 ******************************************************************************/

window.makeNamespace(window,"Rainier.UI.V2");

/**
 * 类型名称：Rainier.UI.V2.DeviceModel<br>
 * 类型功能：通用器件模型<br>
 */
Rainier.UI.V2.DeviceModel = Rainier.UI.V2.CompositeModel.extend({
	
	NAME : "Rainier.UI.V2.DeviceModel",
	
	/**
	 * 函数名称：Rainier.UI.V2.DeviceModel.init<br>
	 * 函数功能：构造函数<br>
	 * 参数输入:property属性对象<br>
	 * 异常信息：无<br>
	 */
	init : function(property){
		var dummy = jQuery.extend(true,{},property);
		this._super(dummy?property:{});
		
		this.tstep = 0;

		this.listIndex = 0;
		this.inConnections = new draw2d.util.ArrayList();
		this.outConnections = new draw2d.util.ArrayList();
	},
	
	/**
	 * 函数名称：Rainier.UI.V2.CompositeModel.serializeToJson<br>
	 * 函数功能：将对象串行化为Json对象<br>
	 * 函数返回：json对象<br>
	 * 异常信息：无<br>
	 */
	serializeToJson : function(){
		var json  = this._super();
		if(this.property.imageProperty){
			this.property.imageProperty.svg = this.property.uiProperty.imageString;
			json.uiProperty.imageHeight = this.property.imageProperty.height;
			json.uiProperty.imageWidth  = this.property.imageProperty.width;
			json.uiProperty.imageString = this.property.imageProperty.svg;
		};
		json.type = this.NAME;//"Rainier.UI.V2.DeviceModel";
		return json;
	},
	
	/**
	 * 函数名称：Rainier.UI.V2.DeviceModel.getTstep<br>
	 * 函数功能：获取步长<br>
	 * 参数输入：无<br>
	 * 参数输出：无<br>
	 * 函数返回：tstep : 初始时间步长<br>
	 * 异常信息：无<br>
	 */
	getTstep : function(){
		var modelPro = this.getProperty().modelProperty;
		if(modelPro){
			var sSpice = modelPro.additional.spiceModel.sm;
			if(sSpice){
				sSpice.replace(/(^\s*)/g, "");
				var spice = sSpice.toLowerCase();
				if(spice.indexOf('v') === 0 || spice.indexOf('i') === 0){
					var value = this.getPropertyValueByName('Frequency');
					if(value != 0){							
						value = 1 / parseFloat(value);
					}
					if(!value){
						value = parseFloat(this.getPropertyValueByName('Time'));
						if(!value){
							var fc = this.getPropertyValueByName('FC');
							var fm;
							if(fc){
								fm = this.getPropertyValueByName('FM');
							}
							if(fc&&fm){
								value = fm;
								if(fc > fm){
									value = fc;
								}
								if(value != 0){							
									value = 1 / parseFloat(value);
								}
							}
						}
					}
					this.tstep = value;
				}				
			}
		}
		return this.tstep;
	},
	
	/**
	
	 * 函数名称：Rainier.UI.V2.DeviceModel.tranlateToSpice<br>
	 * 函数功能：将元件翻译成spice语句<br>
	 * 参数输入：无<br>
	 * 参数输出：无<br>
	 * 函数返回：sSpice:string<br>
	 * 异常信息：无<br>
	 */
	tranlateToSpice : function(){
		var modelPro = this.getProperty().modelProperty;
		if(modelPro){
			var spiceModel = modelPro.additional.spiceModel.sm;
			if(spiceModel){
				spiceModel.replace(/\\t/g,' ');
				var spice = this.replaceSpiceModel(spiceModel,modelPro);
				var index = spice.indexOf('#');
				if(index >= 0){	//特殊虚拟仪器(如：函数信号发生器)存在其他待格式化内容，不存在property中，需返回为空
					spice = '';
				}
				return spice;
			}
		}
		return null;
	},
	
	/**
	 * 函数名称：Rainier.UI.V2.DeviceModel.replaceSpiceModel<br>
	 * 函数功能：格式化spice语句，替换##内容<br>
	 * 参数输入：sSpice ：网表字符串<br>
	 * 参数输入：modelPro ：模型参数<br>
	 * 参数输出：<br>
	 * 函数返回：<br>
	 * 异常信息：<br>
	 */
	replaceSpiceModel : function(sSpice,modelPro){		
		var label = modelPro.label;

		var index = sSpice.indexOf('#');
		while(index >= 0){
			var spaceIndex = sSpice.indexOf('#',index+1);
			var replaceStr = sSpice.substr(index,spaceIndex-index+1);
			var reg=new RegExp("("+replaceStr+")","g");   
			if(replaceStr === '#LABEL#'){
				sSpice = sSpice.replace(reg,label.toLowerCase());
			}
			else if(replaceStr.indexOf('#ND') === 0){
				var replaceStr = sSpice.substr(index+3,spaceIndex-index-3);
				if(replaceStr){
					var port = this.getPortByPortInfo(replaceStr);
					sSpice = sSpice.replace(reg,port.getProperty().modelProperty.node);
				}
			}
			else if(replaceStr.indexOf('#SP') === 0){
				var replaceStr = sSpice.substr(index+3,spaceIndex-index-3);
				if(replaceStr){
					var value = this.getPropertyValueByName(replaceStr);
					sSpice = sSpice.replace(reg,value?value:0);
				}
			}
			var lastIndex = index;
			index = sSpice.indexOf('#');
			if(lastIndex == index){
				break;
			}
		}
		return sSpice;
	},
	

	/**
	 * 函数名称：Rainier.UI.V2.DeviceModel.getPortByPortInfo<br>
	 * 函数功能：将元件翻译成spice语句<br>
	 * 参数输入：无<br>
	 * 参数输出：无<br>
	 * 函数返回：sSpice:string<br>
	 * 异常信息：无<br>
	 */
	getPortByPortInfo : function(portName,portId){
		var sSpice = null;
		var inputs   = this.getInputPorts();
		var outputs  = this.getOutputPorts();
		var hybrids  = this.getHybridPorts();

		var label 	 = this.getProperty().modelProperty.label;
		var _portId	 = null;
		var finded   = null;

		var searchPort = function(i,p){
			var name = p.getProperty().modelProperty.name;
			var id   = p.getProperty().modelProperty.id;
			if(name === portName || id == portId){
				sSpice = p.getProperty().modelProperty.node;
				_portId = id;
				finded = p;
				return false;
			}
		};
		
		//搜索输入、输出、混合端口上的所有出入度连接
		hybrids.each(searchPort);
		if(!finded){	
			inputs.each(searchPort);		
		}
		if(!finded){		
			outputs.each(searchPort);	
		}
		if(sSpice === -1){
			sSpice = 'x'+label+'.'+_portId;
		}
		return finded;
	},
	

	/**
	 * 函数名称：Rainier.UI.V2.DeviceModel.getPropertyValueByName<br>
	 * 函数功能：将元件翻译成spice语句<br>
	 * 参数输入：无<br>
	 * 参数输出：无<br>
	 * 函数返回：sSpice:string<br>
	 * 异常信息：无<br>
	 */
	getPropertyValueByName : function(proName){
		var sSpice = null;
		var _this  = this;	
		var additional = this.getProperty().modelProperty.additional;
		if(additional){
			var proList = additional.spiceProperties;
			$.each(proList,function(index,property){
				if(property.name === proName){
					if(property.validator.isString){
						var reg   = new RegExp("\\.ogg$");     
						var value = property.value.value;
						if(property.name === "Pathname"){
							sSpice = "'"+value+"\\'";
						}else{
							sSpice = "'"+value+"'";							
						}
					}else{
						sSpice = _this.formatValue(property.value.value);
					}
					return false;
				}
			})			
		}
		return sSpice;
	},
	
	/**
	 * 函数名称：Rainier.UI.V2.DeviceModel.formatValue<br>
	 * 函数功能：格式化值 如：1k ==> 1000等<br>
	 * 参数输入：spice ： 原值1k<br>
	 * 参数输出：无<br>
	 * 函数返回：spice ： 格式化值：1000<br>
	 * 异常信息：无<br>
	 */
	formatValue : function(spice){
		var sSpice = spice;
		var lastValue    =   sSpice.charAt(sSpice.length-1);  //截取value值最后一位
        var num          =   0;
        
        var valueArr = {'t':12,'g':9,'M':6,'k':3,'m':-3,'u':-6,'n':-9,'p':-12,'f':-15,};
    	var valueLow     =   (lastValue ===  'M')?lastValue:lastValue.toLowerCase();
		if(valueArr[valueLow]){
    		num = Math.pow(10,valueArr[valueLow]);
    	}else{
    		num = lastValue;
    	}
     	var parameter    =   sSpice.substring(0,sSpice.length-1);
    	var strEresult   =   null;
    	for(var i=0; i<sSpice.length; i++){
			var streBefore    =   sSpice.substr(0,i); //e前面的字符串
			var streAfterOne  =   sSpice.charAt(i+1); //e后面第一位的字符，判断是不是“-”或者“+”
			switch(true){
				case /t|g|m|k|u|n|p|f/gi.test(sSpice) && sSpice[i] === "e" :
					var strAfter      =   sSpice.substr(i+2,sSpice.length-(i+3));
					if(streAfterOne == "+"){
						strEresult    =  Math.pow(10,strAfter);
					}else if(streAfterOne == "-"){
                        strEresult=Math.pow(10,-strAfter);
					}else{
						var strAfter  =  sSpice.substr(i+1,sSpice.length-(i+2));
						strEresult    =  Math.pow(10,strAfter);
					}
						sSpice        =  streBefore*strEresult*num;
				        break;
			    case sSpice[i] === "e" :
				    var strAfter  =  sSpice.substr(i+2,sSpice.length);
					if(streAfterOne == "+"){
						strEresult    =  Math.pow(10,strAfter);
					}else if(streAfterOne == "-"){
						strEresult    =  Math.pow(10,-strAfter);
					}else{
						var strAfter  =  sSpice.substr(i+1,sSpice.length);
						strEresult    =  Math.pow(10,strAfter);
					}
						sSpice  	  =  streBefore*strEresult;
					    break;
				case /t|g|m|k|u|n|p|f/gi.test(sSpice) && /^((?!e).)*$/.test(sSpice) :
					sSpice  =  parseFloat(parameter)*num;
				    break;
				case /^[0-9]*$/.test(sSpice) : 
					sSpice  =  sSpice;
					break;
				default :
					sSpice  = sSpice;
					break;
			}
    	}
		return sSpice;
	},
	
	/**
	 * 函数名称：Rainier.UI.V2.DeviceModel.resetToDefaultValue<br>
	 * 函数功能：恢复当前元件参数的默认值<br>
	 * 参数输入：无<br>
	 * 参数输出：无<br>
	 * 函数返回：无<br>
	 * 异常信息：无<br>
	 */
	resetToDefaultValue : function(){
		var propertyObj = this.getProperty();
		var parameters = propertyObj.modelProperty.additional.spiceProperties;
		for(var index in parameters){
			var defaultValue = parameters[index].defaultValue;
			var currentValue = parameters[index].value;
			if(defaultValue !== currentValue){
				this.getProperty().modelProperty.additional.spiceProperties[index].value = 
					this.getProperty().modelProperty.additional.spiceProperties[index].defaultValue;
			}
		}
	},
	
	/**
	 * 函数名称：Rainier.UI.V2.DeviceModel.showAllLabel<br>
	 * 函数功能：在实验台上显示所有标签<br>
	 * 函数返回：无<br>
	 * 异常信息：无<br>
	 */
	showAllLabel : function(){
		
		if(this.showPinNumber){						
			this.showPinNumber(true,false)
		}
		if(this.showPinSymbol){						
			this.showPinSymbol(true,false)
		}
		if(this.showAllParameter){
			this.showAllParameter(true,false);
		}
		this.showDevName(true,false);
		this.showLabel(true,false);
	},
	
	/**
	 * 函数名称：Rainier.UI.V2.DeviceModel.hideAllLabel<br>
	 * 函数功能：在实验台上显示所有标签<br>
	 * 函数返回：无<br>
	 * 异常信息：无<br>
	 */
	hideAllLabel : function(){
		
		if(this.hidePinNumber){						
			this.hidePinNumber(true,false);
		}
		if(this.hidePinSymbol){						
			this.hidePinSymbol(true,false);
		}
		if(this.hideAllParameter){
			this.hideAllParameter(true,false);
		}
		this.hideDevName(true,false);
		this.hideLabel(true,false);
	},
	
	/**
	 * 函数名称：Rainier.UI.V2.DeviceModel.setPartInfo<br>
	 * 函数功能：设置器件信息<br>
	 * 参数输入：partInfoValue	:String<br>
	 * 参数输入：fireEvent		:boolean是否广播事件<br>
	 * 参数输入：requestCommand:boolean是否请求命令<br>
	 * 参数输入：ommitedListener:忽略的侦听器<br>
	 * 函数返回：无<br>
	 * 异常信息：无<br>
	 */
	setPartInfo : function(partInfoValue,fireEvent,requestCommand,ommitedListener){
		if(this.property){
			if(this.property.modelProperty){
				var modelProperty 	= this.property.modelProperty;
				var oldValue 		= {partInfo:modelProperty.partInfo};
				var newValue		= {partInfo:partInfoValue};
				
				modelProperty.partInfo = partInfoValue;
				
				if(fireEvent){
					newValue.needCommandRequest = requestCommand;
					var event = Rainier.UI.V2.DeviceModel.DEVICE_MODEL_EVENT_PART_INFO_CHANGED;
					this.firePropertyChange(
							event, 
							oldValue, 
							newValue,
							ommitedListener
					);								
				}
				
			}
		}
	},


	/**
	 * 函数名称：Rainier.UI.V2.DeviceModel.setLabel<br>
	 * 函数功能：设置标签<br>
	 * 参数输入：labelValue	:String<br>
	 * 参数输入：fireEvent		:boolean是否广播事件<br>
	 * 参数输入：requestCommand:boolean是否请求命令<br>
	 * 参数输入：ommitedListener:忽略的侦听器<br>
	 * 函数返回：无<br>
	 * 异常信息：无<br>
	 */
	setLabel : function(labelValue,fireEvent,requestCommand,ommitedListener){
		if(this.property){
			if(this.property.modelProperty){
				var modelProperty 	= this.property.modelProperty;
				var oldValue 		= {label:modelProperty.label};
				var newValue		= {label:labelValue};
				
				modelProperty.label = labelValue;
				
				if(fireEvent){
					newValue.needCommandRequest = requestCommand;
					var event = Rainier.UI.V2.DeviceModel.DEVICE_MODEL_EVENT_LABEL_CHANGED;
					this.firePropertyChange(
							event, 
							oldValue, 
							newValue,
							ommitedListener
					);								
				}
				
			}
		}
	},

	/**
	 * 函数名称：Rainier.UI.V2.DeviceModel.setDevName<br>
	 * 函数功能：设置名称标签<br>
	 * 参数输入：devName	:String<br>
	 * 参数输入：fireEvent		:boolean是否广播事件<br>
	 * 参数输入：requestCommand:boolean是否请求命令<br>
	 * 参数输入：ommitedListener:忽略的侦听器<br>
	 * 函数返回：无<br>
	 * 异常信息：无<br>
	 */
	setDevName : function(devName,fireEvent,requestCommand,ommitedListener){
		if(this.property){
			if(this.property.modelProperty){
				var modelProperty 	= this.property.modelProperty;
				var oldValue 		= {componentName:modelProperty.componentName};
				var newValue		= {componentName:devName};
				
				modelProperty.componentName = devName;
				
				if(fireEvent){
					newValue.needCommandRequest = requestCommand;
					var event = Rainier.UI.V2.DeviceModel.DEVICE_MODEL_EVENT_COMPONENTNAME_CHANGED;
					this.firePropertyChange(
							event, 
							oldValue, 
							newValue,
							ommitedListener
					);								
				}
				
			}
		}
	},

	/**
	 * 函数名称：Rainier.UI.V2.DeviceModel.setEngName<br>
	 * 函数功能：设置英文名称标签<br>
	 * 参数输入：engName	:String<br>
	 * 参数输入：fireEvent		:boolean是否广播事件<br>
	 * 参数输入：requestCommand:boolean是否请求命令<br>
	 * 参数输入：ommitedListener:忽略的侦听器<br>
	 * 函数返回：无<br>
	 * 异常信息：无<br>
	 */
	setEngName : function(engName,fireEvent,requestCommand,ommitedListener){
		if(this.property){
			if(this.property.modelProperty){
				var modelProperty 	= this.property.modelProperty;
				var oldValue 		= {engName:modelProperty.engName};
				var newValue		= {engName:engName};
				
				modelProperty.engName = engName;
				
				if(fireEvent){
					newValue.needCommandRequest = requestCommand;
					var event = Rainier.UI.V2.DeviceModel.DEVICE_MODEL_EVENT_ENGNAME_CHANGED;
					this.firePropertyChange(
							event, 
							oldValue, 
							newValue,
							ommitedListener
					);								
				}
				
			}
		}
	},

	/**
	 * 函数名称：Rainier.UI.V2.DeviceModel.setDosage<br>
	 * 函数功能：设置用量<br>
	 * 参数输入：dosage:String<br>
	 * 参数输入：fireEvent		:boolean是否广播事件<br>
	 * 参数输入：requestCommand:boolean是否请求命令<br>
	 * 参数输入：ommitedListener:忽略的侦听器<br>
	 * 函数返回：无<br>
	 * 异常信息：无<br>
	 */
	setDosage : function(dosage,fireEvent,requestCommand,ommitedListener){
		if(this.property){
			if(this.property.modelProperty){
				var modelProperty 	= this.property.modelProperty;
				var oldValue 		= {dosage:modelProperty.dosage};
				var newValue		= {dosage:dosage};
				
				modelProperty.dosage = dosage;
				
				if(fireEvent){
					newValue.needCommandRequest = requestCommand;
					var event = Rainier.UI.V2.DeviceModel.DEVICE_MODEL_EVENT_DOSAGE_CHANGED;
					this.firePropertyChange(
							event, 
							oldValue, 
							newValue,
							ommitedListener
					);								
				}
				
			}
		}
	},

	/**
	 * 函数名称：Rainier.UI.V2.DeviceModel.setDosage<br>
	 * 函数功能：设置单位<br>
	 * 参数输入：dosage:String<br>
	 * 参数输入：fireEvent		:boolean是否广播事件<br>
	 * 参数输入：requestCommand:boolean是否请求命令<br>
	 * 参数输入：ommitedListener:忽略的侦听器<br>
	 * 函数返回：无<br>
	 * 异常信息：无<br>
	 */
	setUnitPrice : function(unitPrice,fireEvent,requestCommand,ommitedListener){
		if(this.property){
			if(this.property.modelProperty){
				var modelProperty 	= this.property.modelProperty;
				var oldValue 		= {unitPrice:modelProperty.unitPrice};
				var newValue		= {unitPrice:unitPrice};
				
				modelProperty.unitPrice = unitPrice;
				
				if(fireEvent){
					newValue.needCommandRequest = requestCommand;
					var event = Rainier.UI.V2.DeviceModel.DEVICE_MODEL_EVENT_UNITPRICE_CHANGED;
					this.firePropertyChange(
							event, 
							oldValue, 
							newValue,
							ommitedListener
					);								
				}
				
			}
		}
	},

	/**
	 * 函数名称：Rainier.UI.V2.DeviceModel.showLabel<br>
	 * 函数功能：在实验台上显示器件标签<br>
	 * 参数输入：fireEvent		:boolean是否广播事件<br>
	 * 参数输入：requestCommand:boolean是否请求命令<br>
	 * 参数输入：ommitedListener:忽略的侦听器<br>
	 * 函数返回：无<br>
	 * 异常信息：无<br>
	 */
	showLabel : function(fireEvent,requestCommand,ommitedListener){
		
		if(!this.property){debugger;return;}
		if(!this.property.modelProperty){debugger;return;}
		if(!this.property.modelProperty.showInfo){debugger;return;}
		if(!this.property.modelProperty.showInfo.showLabel){debugger;return;}
		
		var oldValue = {visiable:this.property.modelProperty.showInfo.showLabel.visiable};
		this.property.modelProperty.showInfo.showLabel.visiable = true;
		var newValue = {visiable:true};
		newValue.needCommandRequest = requestCommand;
		
		if(fireEvent){
			var event = Rainier.UI.V2.DeviceModel.DEVICE_MODEL_EVENT_SHOW_LABEL;
			this.firePropertyChange(
					event, 
					newValue, 
					newValue,
					ommitedListener
			);											
		}
	},
	
	/**
	 * 函数名称：Rainier.UI.V2.DeviceModel.hideLabel<br>
	 * 函数功能：在实验台上隐藏器件标签<br>
	 * 参数输入：fireEvent		:boolean是否广播事件<br>
	 * 参数输入：requestCommand:boolean是否请求命令<br>
	 * 参数输入：ommitedListener:忽略的侦听器<br> 
	 * 函数返回：无<br>
	 * 异常信息：无<br>
	 */
	hideLabel : function(fireEvent,requestCommand,ommitedListener){
		
		if(!this.property){debugger;return;}
		if(!this.property.modelProperty){debugger;return;}
		if(!this.property.modelProperty.showInfo){debugger;return;}
		if(!this.property.modelProperty.showInfo.showLabel){return;}
		
		var oldValue = {visiable:this.property.modelProperty.showInfo.showLabel.visiable};
		this.property.modelProperty.showInfo.showLabel.visiable = false;
		var newValue = {visiable:false};
		
		newValue.needCommandRequest = requestCommand;
		if(fireEvent){
			var event = Rainier.UI.V2.DeviceModel.DEVICE_MODEL_EVENT_HIDE_LABEL;
			this.firePropertyChange(
					event, 
					oldValue, 
					newValue,
					ommitedListener
			);					
		}
	},
	
	/**
	 * 函数名称：Rainier.UI.V2.DeviceModel.showPinNumber<br>
	 * 函数功能：在实验台上显示器件管脚编号<br>
	 * 参数输入：fireEvent		:boolean是否广播事件<br>
	 * 参数输入：requestCommand:boolean是否请求命令<br>
	 * 参数输入：ommitedListener:忽略的侦听器<br> 
	 * 函数返回：无<br>
	 * 异常信息：无<br>
	 */
	showPinNumber : function(fireEvent,requestCommand,ommitedListener){
		
		if(!this.property){debugger;return;}
		if(!this.property.modelProperty){debugger;return;}
		if(!this.property.modelProperty.showInfo){debugger;return;}
		if(!this.property.modelProperty.showInfo.showPinNumber){debugger;return;}
		
		var oldValue = {visiable:this.property.modelProperty.showInfo.showPinNumber.visiable};
		this.property.modelProperty.showInfo.showPinNumber.visiable = true;
		
		var newValue = {visiable:true};
		newValue.needCommandRequest = requestCommand;
		var event = Rainier.UI.V2.DeviceModel.DEVICE_MODEL_EVENT_SHOW_PIN_NUMBER;
		
		if(fireEvent){
			this.firePropertyChange(
					event, 
					oldValue, 
					newValue,
					ommitedListener
			);				
		}
	},
	
	/**
	 * 函数名称：Rainier.UI.V2.DeviceModel.hidePinNumber<br>
	 * 函数功能：在实验台上隐藏器件管脚编号<br>
	 * 参数输入：fireEvent		:boolean是否广播事件<br>
	 * 参数输入：requestCommand:boolean是否请求命令<br>
	 * 参数输入：ommitedListener:忽略的侦听器<br> 
	 * 函数返回：无<br>
	 * 异常信息：无<br>
	 */
	hidePinNumber : function(fireEvent,requestCommand,ommitedListener){
		
		if(!this.property){debugger;return;}
		if(!this.property.modelProperty){debugger;return;}
		if(!this.property.modelProperty.showInfo){debugger;return;}
		if(!this.property.modelProperty.showInfo.showPinNumber){debugger;return;}
		
		var oldValue = {visiable:this.property.modelProperty.showInfo.showPinNumber.visiable};
		this.property.modelProperty.showInfo.showPinNumber.visiable = false;
		var newValue = {visiable:false};
		
		newValue.needCommandRequest = requestCommand;
		var event = Rainier.UI.V2.DeviceModel.DEVICE_MODEL_EVENT_HIDE_PIN_NUMBER;
		
		if(fireEvent){
			this.firePropertyChange(
					event, 
					oldValue, 
					newValue,
					ommitedListener
			);				
		}
	},
	
	/**
	 * 函数名称：Rainier.UI.V2.DeviceModel.showPinSymbol<br>
	 * 函数功能：在实验台上显示器件管脚符号<br>
	 * 参数输入：fireEvent		:boolean是否广播事件<br>
	 * 参数输入：requestCommand:boolean是否请求命令<br>
	 * 参数输入：ommitedListener:忽略的侦听器<br> 
	 * 函数返回：无<br>
	 * 异常信息：无<br>
	 */
	showPinSymbol : function(fireEvent,requestCommand,ommitedListener){
		
		if(!this.property){debugger;return;}
		if(!this.property.modelProperty){debugger;return;}
		if(!this.property.modelProperty.showInfo){debugger;return;}
		if(!this.property.modelProperty.showInfo.showPinSymbol){debugger;return;}
		
		var oldValue = {visiable:this.property.modelProperty.showInfo.showPinSymbol.visiable};
		this.property.modelProperty.showInfo.showPinSymbol.visiable = true;
		var newValue = {visiable:true};
		newValue.needCommandRequest = requestCommand;
		
		var event = Rainier.UI.V2.DeviceModel.DEVICE_MODEL_EVENT_SHOW_PIN_SYMBOL;
		
		if(fireEvent){
			this.firePropertyChange(
					event, 
					oldValue, 
					newValue,
					ommitedListener
			);				
		}
	},
	
	/**
	 * 函数名称：Rainier.UI.V2.DeviceModel.hidePinSymbol<br>
	 * 函数功能：在实验台上隐藏器件管脚符号<br>
	 * 参数输入：fireEvent		:boolean是否广播事件<br>
	 * 参数输入：requestCommand:boolean是否请求命令<br>
	 * 参数输入：ommitedListener:忽略的侦听器<br> 
	 * 函数返回：无<br>
	 * 异常信息：无<br>
	 */
	hidePinSymbol : function(fireEvent,requestCommand,ommitedListener){
		
		if(!this.property){debugger;return;}
		if(!this.property.modelProperty){debugger;return;}
		if(!this.property.modelProperty.showInfo){debugger;return;}
		if(!this.property.modelProperty.showInfo.showPinSymbol){debugger;return;}
		
		var oldValue = {visiable:this.property.modelProperty.showInfo.showPinSymbol.visiable};
		this.property.modelProperty.showInfo.showPinSymbol.visiable = false;
		var newValue = {visiable:false};
		
		newValue.needCommandRequest = requestCommand;
		var event = Rainier.UI.V2.DeviceModel.DEVICE_MODEL_EVENT_HIDE_PIN_SYMBOL;
		
		if(fireEvent){
			this.firePropertyChange(
					event, 
					oldValue, 
					newValue,
					ommitedListener
			);				
		}
	},
	
	/**
	 * 函数名称：Rainier.UI.V2.DeviceModel.showDevName<br>
	 * 函数功能：在实验台上显示器件名称<br>
	 * 参数输入：fireEvent		:boolean是否广播事件<br>
	 * 参数输入：requestCommand:boolean是否请求命令<br>
	 * 参数输入：ommitedListener:忽略的侦听器<br> 
	 * 函数返回：无<br>
	 * 异常信息：无<br>
	 */
	showDevName : function(fireEvent,requestCommand,ommitedListener){
		
		if(!this.property){debugger;return;}
		if(!this.property.modelProperty){debugger;return;}
		if(!this.property.modelProperty.showInfo){debugger;return;}
		if(!this.property.modelProperty.showInfo.showComponentName){debugger;return;}
		
		var oldValue = {visiable:this.property.modelProperty.showInfo.showComponentName.visiable};
		this.property.modelProperty.showInfo.showComponentName.visiable = true;
		var newValue = {visiable:true};

		newValue.needCommandRequest = requestCommand;
		var event = Rainier.UI.V2.DeviceModel.DEVICE_MODEL_EVENT_SHOW_DEV_NAME;
		
		if(fireEvent){
			this.firePropertyChange(
					event, 
					oldValue, 
					newValue,
					ommitedListener
			);				
		}
	},
	
	/**
	 * 函数名称：Rainier.UI.V2.DeviceModel.hideDevName<br>
	 * 函数功能：在实验台上隐藏器件名称<br>
	 * 参数输入：fireEvent		:boolean是否广播事件<br>
	 * 参数输入：requestCommand:boolean是否请求命令<br>
	 * 参数输入：ommitedListener:忽略的侦听器<br> 
	 * 函数返回：无<br>
	 * 异常信息：无<br>
	 */
	hideDevName : function(fireEvent,requestCommand,ommitedListener){
		
		if(!this.property){debugger;return;}
		if(!this.property.modelProperty){debugger;return;}
		if(!this.property.modelProperty.showInfo){debugger;return;}
		if(!this.property.modelProperty.showInfo.showComponentName){debugger;return;}
		
		var oldValue = {visiable:this.property.modelProperty.showInfo.showComponentName.visiable};
		this.property.modelProperty.showInfo.showComponentName.visiable = false;
		var newValue = {visiable:false};
		
		newValue.needCommandRequest = requestCommand;
		var event = Rainier.UI.V2.DeviceModel.DEVICE_MODEL_EVENT_HIDE_DEV_NAME;
		
		if(fireEvent){
			this.firePropertyChange(
					event, 
					oldValue, 
					newValue,
					ommitedListener
			);			
		}
	},
	
	
	
	
	/**
	 * 函数名称：Rainier.UI.V2.DeviceModel.showEngName<br>
	 * 函数功能：在实验台上显示器件英文名称<br>
	 * 参数输入：fireEvent		:boolean是否广播事件<br>
	 * 参数输入：requestCommand:boolean是否请求命令<br>
	 * 参数输入：ommitedListener:忽略的侦听器<br> 
	 * 函数返回：无<br>
	 * 异常信息：无<br>
	 */
	showEngName : function(fireEvent,requestCommand,ommitedListener){
		
		if(!this.property){debugger;return;}
		if(!this.property.modelProperty){debugger;return;}
		if(!this.property.modelProperty.showInfo){debugger;return;}
		if(!this.property.modelProperty.showInfo.showEngName){debugger;return;}
		
		var oldValue = {visiable:this.property.modelProperty.showInfo.showEngName.visiable};
		this.property.modelProperty.showInfo.showEngName.visiable = true;
		var newValue = {visiable:true};
	
		newValue.needCommandRequest = requestCommand;
		var event = Rainier.UI.V2.DeviceModel.DEVICE_MODEL_EVENT_SHOW_ENG_NAME;
		
		if(fireEvent){
			this.firePropertyChange(
					event, 
					oldValue, 
					newValue,
					ommitedListener
			);				
		}
	},
	
	/**
	 * 函数名称：Rainier.UI.V2.DeviceModel.hideEngName<br>
	 * 函数功能：在实验台上隐藏器件英文名称<br>
	 * 参数输入：fireEvent		:boolean是否广播事件<br>
	 * 参数输入：requestCommand:boolean是否请求命令<br>
	 * 参数输入：ommitedListener:忽略的侦听器<br> 
	 * 函数返回：无<br>
	 * 异常信息：无<br>
	 */
	hideEngName : function(fireEvent,requestCommand,ommitedListener){
		
		if(!this.property){debugger;return;}
		if(!this.property.modelProperty){debugger;return;}
		if(!this.property.modelProperty.showInfo){debugger;return;}
		if(!this.property.modelProperty.showInfo.showEngName){debugger;return;}
		
		var oldValue = {visiable:this.property.modelProperty.showInfo.showEngName.visiable};
		this.property.modelProperty.showInfo.showEngName.visiable = false;
		var newValue = {visiable:false};
		
		newValue.needCommandRequest = requestCommand;
		var event = Rainier.UI.V2.DeviceModel.DEVICE_MODEL_EVENT_HIDE_ENG_NAME;
		
		if(fireEvent){
			this.firePropertyChange(
					event, 
					oldValue, 
					newValue,
					ommitedListener
			);			
		}
	},
	
	
	
	/**
	 * 函数名称：Rainier.UI.V2.DeviceModel.setParameter<br>
	 * 函数功能：设置器件模型参数值<br>
	 * 参数输入：paraIndex		:参数编号<br>
	 * 参数输入：paraValue		:参数值<br>
	 * 参数输入：fireEvent		:boolean是否广播事件<br>
	 * 参数输入：requestCommand:boolean是否请求命令<br>
	 * 参数输入：ommitedListener:忽略的侦听器<br> 
	 * 函数返回：无<br>
	 * 异常信息：无<br>
	 */
	setParameter : function(paraIndex,paraValue,fireEvent,requestCommand,ommitedListener){
		
		if(!this.property){debugger;return;}
		if(!this.property.modelProperty){debugger;return;}
		if(!this.property.modelProperty.additional){debugger;return;}
		if(!this.property.modelProperty.additional.spiceProperties){debugger;return;}
		if(!this.property.modelProperty.additional.spiceProperties[paraIndex]){debugger;return;}
		
		var oldValue 		= {index:paraIndex,value:this.property.modelProperty.additional.spiceProperties[paraIndex].value.value};
		var newValue		= {index:paraIndex,value:paraValue};
		
		this.property.modelProperty.additional.spiceProperties[paraIndex].value.value = paraValue;
		
		if(fireEvent){
			newValue.needCommandRequest = requestCommand;
			var event = Rainier.UI.V2.DeviceModel.DEVICE_MODEL_EVENT_PARA_VALUE_CHANGED;
			this.firePropertyChange(
					event, 
					oldValue, 
					newValue,
					ommitedListener
			);								
		}
	},
	
	/**
	 * 函数名称：Rainier.UI.V2.DeviceModel.setName<br>
	 * 函数功能：设置器件模型参数名称<br>
	 * 参数输入：paraIndex		:参数编号<br>
	 * 参数输入：paraName		:参数名称<br>
	 * 参数输入：fireEvent		:boolean是否广播事件<br>
	 * 参数输入：requestCommand:boolean是否请求命令<br>
	 * 参数输入：ommitedListener:忽略的侦听器<br> 
	 * 函数返回：无<br>
	 * 异常信息：无<br>
	 */
	setName : function(paraIndex,paraName,fireEvent,requestCommand,ommitedListener){
		
		if(!this.property){debugger;return;}
		if(!this.property.modelProperty){debugger;return;}
		if(!this.property.modelProperty.additional){debugger;return;}
		if(!this.property.modelProperty.additional.spiceProperties){debugger;return;}
		if(!this.property.modelProperty.additional.spiceProperties[paraIndex]){debugger;return;}
		
		var oldValue 		= {index:paraIndex,value:this.property.modelProperty.additional.spiceProperties[paraIndex].name};
		var newValue		= {index:paraIndex,value:paraName};
		
		this.property.modelProperty.additional.spiceProperties[paraIndex].name = paraName;
		
		if(fireEvent){
			newValue.needCommandRequest = requestCommand;
			var event = Rainier.UI.V2.DeviceModel.DEVICE_MODEL_EVENT_PARA_NAME_CHANGED;
			this.firePropertyChange(
					event, 
					oldValue, 
					newValue,
					ommitedListener
			);								
		}
	},

	/**
	 * 函数名称：Rainier.UI.V2.DeviceModel.setUnitType<br>
	 * 函数功能：设置器件模型参数单位<br>
	 * 参数输入：paraIndex		:参数编号<br>
	 * 参数输入：paraUnitType		:参数单位<br>
	 * 参数输入：fireEvent		:boolean是否广播事件<br>
	 * 参数输入：requestCommand:boolean是否请求命令<br>
	 * 参数输入：ommitedListener:忽略的侦听器<br> 
	 * 函数返回：无<br>
	 * 异常信息：无<br>
	 */
	setUnitType : function(paraIndex,paraUnitType,fireEvent,requestCommand,ommitedListener){
		
		if(!this.property){debugger;return;}
		if(!this.property.modelProperty){debugger;return;}
		if(!this.property.modelProperty.additional){debugger;return;}
		if(!this.property.modelProperty.additional.spiceProperties){debugger;return;}
		if(!this.property.modelProperty.additional.spiceProperties[paraIndex]){debugger;return;}
		
		var oldValue 		= {index:paraIndex,value:this.property.modelProperty.additional.spiceProperties[paraIndex].unit.unitType};
		var newValue		= {index:paraIndex,value:paraUnitType};
		
		this.property.modelProperty.additional.spiceProperties[paraIndex].unit.unitType = paraUnitType;
		
		if(fireEvent){
			newValue.needCommandRequest = requestCommand;
			var event = Rainier.UI.V2.DeviceModel.DEVICE_MODEL_EVENT_PARA_UNIT_TYPE_CHANGED;
			this.firePropertyChange(
					event, 
					oldValue, 
					newValue,
					ommitedListener
			);								
		}
	},
	
	/**
	 * 函数名称：Rainier.UI.V2.DeviceModel.setMemo<br>
	 * 函数功能：设置器件模型参数单位<br>
	 * 参数输入：paraIndex		:参数编号<br>
	 * 参数输入：paraMemo		:参数备注<br>
	 * 参数输入：fireEvent		:boolean是否广播事件<br>
	 * 参数输入：requestCommand:boolean是否请求命令<br>
	 * 参数输入：ommitedListener:忽略的侦听器<br> 
	 * 函数返回：无<br>
	 * 异常信息：无<br>
	 */
	setMemo : function(paraIndex,paraMemo,fireEvent,requestCommand,ommitedListener){
		
		if(!this.property){debugger;return;}
		if(!this.property.modelProperty){debugger;return;}
		if(!this.property.modelProperty.additional){debugger;return;}
		if(!this.property.modelProperty.additional.spiceProperties){debugger;return;}
		if(!this.property.modelProperty.additional.spiceProperties[paraIndex]){debugger;return;}
		
		var oldValue 		= {index:paraIndex,value:this.property.modelProperty.additional.spiceProperties[paraIndex].memo};
		var newValue		= {index:paraIndex,value:paraMemo};
		
		this.property.modelProperty.additional.spiceProperties[paraIndex].memo = paraMemo;
		
		if(fireEvent){
			newValue.needCommandRequest = requestCommand;
			var event = Rainier.UI.V2.DeviceModel.DEVICE_MODEL_EVENT_PARA_MEMO_CHANGED;
			this.firePropertyChange(
					event, 
					oldValue, 
					newValue,
					ommitedListener
			);								
		}
	},

	/**
	 * 函数名称：Rainier.UI.V2.DeviceModel.setCaption<br>
	 * 函数功能：设置器件模型参数备注<br>
	 * 参数输入：paraIndex		:参数编号<br>
	 * 参数输入：paraCaption		:参数备注<br>
	 * 参数输入：fireEvent		:boolean是否广播事件<br>
	 * 参数输入：requestCommand:boolean是否请求命令<br>
	 * 参数输入：ommitedListener:忽略的侦听器<br> 
	 * 函数返回：无<br>
	 * 异常信息：无<br>
	 */
	setCaption : function(paraIndex,paraCaption,fireEvent,requestCommand,ommitedListener){
		
		if(!this.property){debugger;return;}
		if(!this.property.modelProperty){debugger;return;}
		if(!this.property.modelProperty.additional){debugger;return;}
		if(!this.property.modelProperty.additional.spiceProperties){debugger;return;}
		if(!this.property.modelProperty.additional.spiceProperties[paraIndex]){debugger;return;}
		
		var oldCaption 		= {index:paraIndex,value:this.property.modelProperty.additional.spiceProperties[paraIndex].caption};
		var newCaption		= {index:paraIndex,value:paraCaption};
		
		this.property.modelProperty.additional.spiceProperties[paraIndex].caption = paraCaption;
		
		if(fireEvent){
			newCaption.needCommandRequest = requestCommand;
			var event = Rainier.UI.V2.DeviceModel.DEVICE_MODEL_EVENT_PARA_CAPTION_CHANGED;
			this.firePropertyChange(
					event, 
					oldCaption, 
					newCaption,
					ommitedListener
			);								
		}
	},

	/**
	 * 函数名称：Rainier.UI.V2.DeviceModel.showParameter<br>
	 * 函数功能：在实验台上显示器件模型参数<br>
	 * 参数输入：paraIndex		:参数编号<br>
	 * 参数输入：fireEvent		:boolean是否广播事件<br>
	 * 参数输入：requestCommand:boolean是否请求命令<br>
	 * 参数输入：ommitedListener:忽略的侦听器<br> 
	 * 函数返回：无<br>
	 * 异常信息：无<br>
	 */
	showParameter : function(paraIndex,fireEvent,requestCommand,ommitedListener){
		
		if(!this.property){debugger;return;}
		if(!this.property.modelProperty){debugger;return;}
		if(!this.property.modelProperty.additional){debugger;return;}
		if(!this.property.modelProperty.additional.spiceProperties){debugger;return;}
		if(!this.property.modelProperty.additional.spiceProperties[paraIndex]){debugger;return;}
		if(!this.property.modelProperty.additional.spiceProperties[paraIndex].showInfo){debugger;return;}

		var oldValue = {index:paraIndex,visiable:this.property.modelProperty.additional.spiceProperties[paraIndex].showInfo.visiable};
		this.property.modelProperty.additional.spiceProperties[paraIndex].showInfo.visiable = true;
		var newValue = {index:paraIndex,visiable:true};

		newValue.needCommandRequest = requestCommand;
		var event = Rainier.UI.V2.DeviceModel.DEVICE_MODEL_EVENT_SHOW_PARA;
		
		if(fireEvent){
			this.firePropertyChange(
					event, 
					oldValue, 
					newValue,
					ommitedListener
			);			
		}
	},
	
	/**
	 * 函数名称：Rainier.UI.V2.DeviceModel.showParameter<br>
	 * 函数功能：在实验台上隐藏器件模型参数<br>
	 * 参数输入：paraIndex		:参数编号<br>
	 * 参数输入：fireEvent		:boolean是否广播事件<br>
	 * 参数输入：requestCommand:boolean是否请求命令<br>
	 * 参数输入：ommitedListener:忽略的侦听器<br>
	 * 函数返回：无<br>
	 * 异常信息：无<br>
	 */
	hideParameter : function(paraIndex,fireEvent,requestCommand,ommitedListener){
		
		if(!this.property){debugger;return;}
		if(!this.property.modelProperty){debugger;return;}
		if(!this.property.modelProperty.additional){debugger;return;}
		if(!this.property.modelProperty.additional.spiceProperties){debugger;return;}
		if(!this.property.modelProperty.additional.spiceProperties[paraIndex]){debugger;return;}
		if(!this.property.modelProperty.additional.spiceProperties[paraIndex].showInfo){debugger;return;}

		var oldValue = {index:paraIndex,visiable:this.property.modelProperty.additional.spiceProperties[paraIndex].showInfo.visiable};
		this.property.modelProperty.additional.spiceProperties[paraIndex].showInfo.visiable = false;
		var newValue = {index:paraIndex,visiable:false};
		
		newValue.needCommandRequest = requestCommand;
		var event = Rainier.UI.V2.DeviceModel.DEVICE_MODEL_EVENT_HIDE_PARA;
		
		if(fireEvent){
			this.firePropertyChange(
					event, 
					oldValue, 
					newValue,
					ommitedListener
			);			
		}
	},
	
	/**
	 * 函数名称：Rainier.UI.V2.DeviceModel.showAllParameter<br>
	 * 函数功能：在实验台上显示器件模型参数<br>
	 * 参数输入：fireEvent		:boolean是否广播事件<br>
	 * 参数输入：requestCommand:boolean是否请求命令<br>
	 * 参数输入：ommitedListener:忽略的侦听器<br> 
	 * 函数返回：无<br>
	 * 异常信息：无<br>
	 */
	showAllParameter : function(fireEvent,requestCommand,ommitedListener){
		
		if(!this.property){debugger;return;}
		if(!this.property.modelProperty){debugger;return;}
		if(!this.property.modelProperty.additional){debugger;return;}
		if(!this.property.modelProperty.additional.spiceProperties){debugger;return;}
		var event = Rainier.UI.V2.DeviceModel.DEVICE_MODEL_EVENT_SHOW_ALL_PARA;
		
		var oldValue = {visiable:false};
		var newValue = {visiable:true};
		newValue.needCommandRequest = requestCommand;
		
		if(fireEvent){
			this.firePropertyChange(
					event, 
					oldValue, 
					newValue,
					ommitedListener
			);			
		}
	},
	
	/**
	 * 函数名称：Rainier.UI.V2.DeviceModel.showParameter<br>
	 * 函数功能：在实验台上隐藏器件模型参数<br>
	 * 参数输入：fireEvent		:boolean是否广播事件<br>
	 * 参数输入：requestCommand:boolean是否请求命令<br>
	 * 参数输入：ommitedListener:忽略的侦听器<br>
	 * 函数返回：无<br>
	 * 异常信息：无<br>
	 */
	hideAllParameter : function(fireEvent,requestCommand,ommitedListener){
		
		if(!this.property){debugger;return;}
		if(!this.property.modelProperty){debugger;return;}
		if(!this.property.modelProperty.additional){debugger;return;}
		if(!this.property.modelProperty.additional.spiceProperties){debugger;return;}

		var event = Rainier.UI.V2.DeviceModel.DEVICE_MODEL_EVENT_HIDE_ALL_PARA;
		
		var oldValue = {visiable:true};
		var newValue = {visiable:false};
		newValue.needCommandRequest = requestCommand;
		
		if(fireEvent){
			this.firePropertyChange(
					event, 
					oldValue, 
					newValue,
					ommitedListener
			);			
		}
	},
	
	/**
	 * 函数名称：Rainier.UI.V2.DeviceModel.getOwnPorts<br>
	 * 函数功能：获取model上的所有port<br>
	 * 参数输入：无<br>
	 * 参数输出：无<br>
	 * 函数返回：PortList<br>
	 * 异常信息：无<br>
	 */
	getOwnPorts : function(){
		var portList = new draw2d.util.ArrayList();
		var inputs   = this.getInputPorts();
		var outputs  = this.getOutputPorts();
		var hybrids  = this.getHybridPorts();
		
		inputs.each(function(i,p){
			portList.add(p);
		});
		
		outputs.each(function(i,p){
			portList.add(p);
		});
		
		hybrids.each(function(i,p){
			portList.add(p);
		});
		return portList;
	},
	
	/**
	 * 函数名称：Rainier.UI.V2.DeviceModel.getAssociationConnection<br>
	 * 函数功能：获取与model有直接关联的连线<br>
	 * 参数输入：无<br>
	 * 参数输出：无<br>
	 * 函数返回：connList<br>
	 * 异常信息：无<br>
	 */
	getAssociationConnection : function(){
		var connList = new draw2d.util.ArrayList();
		var inputs   = this.getInputPorts();
		var outputs  = this.getOutputPorts();
		var hybrids  = this.getHybridPorts();
		var _this = this;

		this.inConnections.clear();
		this.outConnections.clear();
		var getConns = function(i,p){
			var incomings = p.getIncomings();
			var outgoings = p.getOutgoings();
			incomings.each(function(j,c){
				connList.add(c);
				_this.inConnections.push(c);
			});
			outgoings.each(function(j,c){
				connList.add(c);
				_this.outConnections.push(c);
			});
		};
		
		inputs.each(getConns);
		
		outputs.each(getConns);
		
		hybrids.each(getConns);
		return connList;
	},

	getInConns : function(){
		this.getAssociationConnection();
		return this.inConnections;
	},

	getOutConns : function(){
		this.getAssociationConnection();
		return this.outConnections;
	},

	getHeadModels : function(){
		var headModels = [];
		var inConns = this.getInConns();
		inConns.each(function(i,inCOnn){
			var source = inConns.sourcePort;
			if (source) {
				headModels.push(source.getParent());
			}
		})
		return headModels;
	},

	getNextModels : function(){
		var nextModels = [];
		var outConns = this.getOutConns();
		outConns.each(function(i,outConn){
			var target = outConn.targetPort;
			if (target) {
				nextModels.push(target.getParent());
			}
		})
		return nextModels;
	},

	getConnectModelByPortId : function(portId){
		var port   	= this.getPortByPortInfo(null,portId);
		var models  = {};
		models.sources = [];
		models.targets = [];

		var incomings = port.getIncomings();
		var outgoings = port.getOutgoings();
		incomings.each(function(j,c){
			var source = c.sourcePort.getParent();
			if (models.sources.indexOf(source) < 0) {
				models.sources.push(source);
			}
		});
		outgoings.each(function(j,c){
			var target = c.targetPort.getParent();
			if (models.targets.indexOf(target) < 0) {
				models.targets.push(target);
			}
		});
		return models;
	},

	setIndex : function(index){
		if (index > this.listIndex) {
			this.listIndex = index;
		}
	},

	getIndex : function(){
		return this.listIndex;
	},
});

//DeviceModel事件定义：修改标签，partInfo属性值改变
Rainier.UI.V2.DeviceModel.DEVICE_MODEL_EVENT_PART_INFO_CHANGED 		= "DEVICE_MODEL_EVENT_PART_INFO_CHANGED";

//DeviceModel事件定义：修改标签，label属性值改变
Rainier.UI.V2.DeviceModel.DEVICE_MODEL_EVENT_LABEL_CHANGED 		= "DEVICE_MODEL_EVENT_LABEL_CHANGED";	

//DeviceModel事件定义：修改器件名，componentName属性值改变
Rainier.UI.V2.DeviceModel.DEVICE_MODEL_EVENT_COMPONENTNAME_CHANGED 		= "DEVICE_MODEL_EVENT_COMPONENTNAME_CHANGED";	

//DeviceModel事件定义：修改器件英文名，engName属性值改变
Rainier.UI.V2.DeviceModel.DEVICE_MODEL_EVENT_ENGNAME_CHANGED 		= "DEVICE_MODEL_EVENT_ENGNAME_CHANGED";

//DeviceModel事件定义：修改单价，unitPrice属性值改变
Rainier.UI.V2.DeviceModel.DEVICE_MODEL_EVENT_UNITPRICE_CHANGED 		= "DEVICE_MODEL_EVENT_UINTPRICE_CHANGED";	

//DeviceModel事件定义：修改用量，dosage属性值改变
Rainier.UI.V2.DeviceModel.DEVICE_MODEL_EVENT_DOSAGE_CHANGED 		= "DEVICE_MODEL_EVENT_DOSAGE_CHANGED";	

//DeviceModel事件定义：修改名称字段，name属性值改变
Rainier.UI.V2.DeviceModel.DEVICE_MODEL_EVENT_PARA_NAME_CHANGED 		= "DEVICE_MODEL_EVENT_PARA_NAME_CHANGED";	

//DeviceModel事件定义：修改单位字段，unitPrice属性值改变
Rainier.UI.V2.DeviceModel.DEVICE_MODEL_EVENT_PARA_UNIT_TYPE_CHANGED 		= "DEVICE_MODEL_EVENT_PARA_UNIT_TYPE_CHANGED";	

//DeviceModel事件定义：修改备注，caption属性值改变
Rainier.UI.V2.DeviceModel.DEVICE_MODEL_EVENT_PARA_CAPTION_CHANGED 		= "DEVICE_MODEL_EVENT_PARA_CAPTION_CHANGED";
	
//DeviceModel事件定义：修改备注，memo属性值改变
Rainier.UI.V2.DeviceModel.DEVICE_MODEL_EVENT_PARA_MEMO_CHANGED 		= "DEVICE_MODEL_EVENT_PARA_MEMO_CHANGED";

//DeviceModel事件定义：显示标签
Rainier.UI.V2.DeviceModel.DEVICE_MODEL_EVENT_SHOW_LABEL    		= "DEVICE_MODEL_EVENT_SHOW_LABEL";

//DeviceModel事件定义：隐藏标签
Rainier.UI.V2.DeviceModel.DEVICE_MODEL_EVENT_HIDE_LABEL  		= "DEVICE_MODEL_EVENT_UNSHOW_LABEL";

//DeviceModel事件定义：显示引脚的编号
Rainier.UI.V2.DeviceModel.DEVICE_MODEL_EVENT_SHOW_PIN_NUMBER  	= "DEVICE_MODEL_EVENT_SHOW_PIN_NUMBER";

//DeviceModel事件定义：隐藏引脚的编号
Rainier.UI.V2.DeviceModel.DEVICE_MODEL_EVENT_HIDE_PIN_NUMBER  	= "DEVICE_MODEL_EVENT_UNSHOW_PIN_NUMBER";

//DeviceModel事件定义：显示引脚的符号
Rainier.UI.V2.DeviceModel.DEVICE_MODEL_EVENT_SHOW_PIN_SYMBOL    = "DEVICE_MODEL_EVENT_SHOW_PIN_SYMBOL";

//DeviceModel事件定义：隐藏引脚的符号
Rainier.UI.V2.DeviceModel.DEVICE_MODEL_EVENT_HIDE_PIN_SYMBOL    = "DEVICE_MODEL_EVENT_HIDE_PIN_SYMBOL";

//DeviceModel事件定义：显示设备名称
Rainier.UI.V2.DeviceModel.DEVICE_MODEL_EVENT_SHOW_DEV_NAME      = "DEVICE_MODEL_EVENT_SHOW_DEV_NAME";

//DeviceModel事件定义：隐藏设备名称
Rainier.UI.V2.DeviceModel.DEVICE_MODEL_EVENT_HIDE_DEV_NAME    	= "DEVICE_MODEL_EVENT_UNSHOW_DEV_NAME";

//DeviceModel事件定义：显示设备英文名称
Rainier.UI.V2.DeviceModel.DEVICE_MODEL_EVENT_SHOW_DEV_ENG_NAME      = "DEVICE_MODEL_EVENT_SHOW_DEV_ENG_NAME";

//DeviceModel事件定义：隐藏设备英文名称
Rainier.UI.V2.DeviceModel.DEVICE_MODEL_EVENT_HIDE_DEV_ENG_NAME    	= "DEVICE_MODEL_EVENT_UNSHOW_DEV_ENG_NAME";

//DeviceModel事件定义：修改模型参数
Rainier.UI.V2.DeviceModel.DEVICE_MODEL_EVENT_PARA_VALUE_CHANGED = "DEVICE_MODEL_EVENT_PARA_VALUE_CHANGED";

//DeviceModel事件定义：显示模型参数
Rainier.UI.V2.DeviceModel.DEVICE_MODEL_EVENT_SHOW_PARA 			= "DEVICE_MODEL_EVENT_SHOW_PARA";

//DeviceModel事件定义：隐藏模型参数
Rainier.UI.V2.DeviceModel.DEVICE_MODEL_EVENT_HIDE_PARA 			= "DEVICE_MODEL_EVENT_UNSHOW_PARA";

//DeviceModel事件定义：显示所有模型参数
Rainier.UI.V2.DeviceModel.DEVICE_MODEL_EVENT_SHOW_ALL_PARA 			= "DEVICE_MODEL_EVENT_SHOW_ALL_PARA";

//DeviceModel事件定义：隐藏所有模型参数
Rainier.UI.V2.DeviceModel.DEVICE_MODEL_EVENT_HIDE_ALL_PARA 			= "DEVICE_MODEL_EVENT_UNSHOW_ALL_PARA";




